

package com.hazelcast.internal.config;

import com.hazelcast.config.UserCodeNamespaceConfig;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.net.URL;

public class UserCodeNamespaceConfigReadOnly extends UserCodeNamespaceConfig {

    public UserCodeNamespaceConfigReadOnly(UserCodeNamespaceConfig config) {
        super(config);
    }

    @Override
    public UserCodeNamespaceConfig setName(String name) {
        throw new UnsupportedOperationException("This config is read-only namespace: " + getName());
    }


    @Override
    public UserCodeNamespaceConfig addClass(@Nonnull Class<?>... classes) {
        throw new UnsupportedOperationException("This config is read-only namespace: " + getName());
    }

    @Override
    public UserCodeNamespaceConfig addClass(@Nonnull URL url, @Nullable String id) {
        throw new UnsupportedOperationException("This config is read-only namespace: " + getName());
    }

    @Override
    public UserCodeNamespaceConfig addJar(@Nonnull URL url, @Nullable String id) {
        throw new UnsupportedOperationException("This config is read-only namespace: " + getName());
    }

    @Override
    public UserCodeNamespaceConfig addJarsInZip(@Nonnull URL url, @Nullable String id) {
        throw new UnsupportedOperationException("This config is read-only namespace: " + getName());
    }
}
